package com.ruoyi.project.wechatprogram.moneyoperatelog.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.wechatprogram.moneyoperatelog.mapper.WxMoneyOperateLogMapper;
import com.ruoyi.project.wechatprogram.moneyoperatelog.domain.WxMoneyOperateLog;
import com.ruoyi.project.wechatprogram.moneyoperatelog.service.IWxMoneyOperateLogService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 员工金额变动记录Service业务层处理
 * 
 * @author xinchen
 * @date 2020-05-21
 */
@Service
public class WxMoneyOperateLogServiceImpl implements IWxMoneyOperateLogService 
{
    @Autowired
    private WxMoneyOperateLogMapper wxMoneyOperateLogMapper;

    /**
     * 查询员工金额变动记录
     * 
     * @param id 员工金额变动记录ID
     * @return 员工金额变动记录
     */
    @Override
    public WxMoneyOperateLog selectWxMoneyOperateLogById(Integer id)
    {
        return wxMoneyOperateLogMapper.selectWxMoneyOperateLogById(id);
    }

    /**
     * 查询员工金额变动记录列表
     * 
     * @param wxMoneyOperateLog 员工金额变动记录
     * @return 员工金额变动记录
     */
    @Override
    public List<WxMoneyOperateLog> selectWxMoneyOperateLogList(WxMoneyOperateLog wxMoneyOperateLog)
    {
        return wxMoneyOperateLogMapper.selectWxMoneyOperateLogList(wxMoneyOperateLog);
    }

    /**
     * 查询员工金额变动记录列表-个人
     *
     * @return 员工金额变动记录
     */
    @Override
    public List<WxMoneyOperateLog> selectWxMoneyOperateLogListByPhone(String phone)
    {
        return wxMoneyOperateLogMapper.selectWxMoneyOperateLogListByPhone(phone);
    }

    /**
     * 新增员工金额变动记录
     * 
     * @param wxMoneyOperateLog 员工金额变动记录
     * @return 结果
     */
    @Override
    public int insertWxMoneyOperateLog(WxMoneyOperateLog wxMoneyOperateLog)
    {
        wxMoneyOperateLog.setCreateTime(DateUtils.getNowDate());
        return wxMoneyOperateLogMapper.insertWxMoneyOperateLog(wxMoneyOperateLog);
    }

    /**
     * 修改员工金额变动记录
     * 
     * @param wxMoneyOperateLog 员工金额变动记录
     * @return 结果
     */
    @Override
    public int updateWxMoneyOperateLog(WxMoneyOperateLog wxMoneyOperateLog)
    {
        wxMoneyOperateLog.setUpdateTime(DateUtils.getNowDate());
        return wxMoneyOperateLogMapper.updateWxMoneyOperateLog(wxMoneyOperateLog);
    }

    /**
     * 修改员工金额变动记录
     *
     * @param wxMoneyOperateLogList 批量员工金额变动记录
     * @return 结果
     */
    @Override
    public int insertWxMoneyOperateLogList(List<WxMoneyOperateLog> wxMoneyOperateLogList)
    {

        return wxMoneyOperateLogMapper.insertWxMoneyOperateLogList(wxMoneyOperateLogList);
    }

    /**
     * 删除员工金额变动记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWxMoneyOperateLogByIds(String ids)
    {
        return wxMoneyOperateLogMapper.deleteWxMoneyOperateLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除员工金额变动记录信息
     * 
     * @param id 员工金额变动记录ID
     * @return 结果
     */
    @Override
    public int deleteWxMoneyOperateLogById(Integer id)
    {
        return wxMoneyOperateLogMapper.deleteWxMoneyOperateLogById(id);
    }
}
